package com.twu.bibilioteca;

import junit.framework.TestCase;
import org.junit.Before;
import org.junit.Test;

import static junit.framework.Assert.assertEquals;

/**
 * Created by IntelliJ IDEA.
 * User: dixithk
 * Date: 6/20/14
 * Time: 1:09 PM
 * To change this template use File | Settings | File Templates.
 */
public class loginTest {


    Library lib = new Library();

    
    @Test
    public void shouldCheckForValidLogin()
    {
        lib.loadUsers();
      Result c = new Login(new UserInterfaceTest("dummy") , lib).action();
        assertEquals(new Result("Logged in Successfully ! Enjoy the Services " , true)  , c);
    }

    @Test
    public void shouldCheckForInValidLogin()
    {

        Result c = new Login(new UserInterfaceTest("dummy") , lib).action();
        assertEquals(new Result("Login Failed !!!!", false)   , c);
    }




}
